﻿using FarmSmartSleep.Common.Domain;
using FarmSmartSleep.Common.Dtos;
using FarmSmartSleep.Common.Infrastructure;
using MediatR;

namespace FarmSmartSleep.Organ.API.Application.Commands.SheepFarmCommands
{
    public class SheepFarmFillHandler : IRequestHandler<SheepFarmFillCommand, Result>
    {
        private readonly IBaseRepository<SheepFarm> sheepfarmRep;

        public SheepFarmFillHandler(IBaseRepository<SheepFarm> sheepfarmRep)
        {
            this.sheepfarmRep = sheepfarmRep;
        }

        public async Task<Result> Handle(SheepFarmFillCommand request, CancellationToken cancellationToken)
        {
            var res = new Result() { Code = (int)CodeEnum.update };

           res.Data =  sheepfarmRep.GetById(request.FarmId);
            return res;

        }
    }
}
